# -*- coding: utf-8 -*-
import json
import codecs

with open('../data.json') as data:
    data_list = json.load(data)
    for i in data_list:
        text = "\n"+i['title']+"\n"+i['text'][0].replace('\n','').strip()+"\n"+i['comment']+"\t"+i['browse']+"\t"+i['tag']+" 发布于:"+i['time']+"\n\r"
        file = codecs.open('../text.txt','a',encoding='utf-8')
        file.write(text)
        file.write("--------------------------------------------------------------------------------------------------------------------------")
        file.close()